<?php

namespace app\admin\model;

use think\Model;

class Permission extends Model
{
    protected $name = 'permissions';
    protected $pk = 'id';
    protected $autoWriteTimestamp = false;

    protected $type = [
        'id' => 'integer',
        'is_disabled' => 'integer',
    ];

    public function roles()
    {
        return $this->belongsToMany(Role::class, 'role_permissions', 'role_id', 'permission_id');
    }
}


